package com.dsg.entity.apply;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 車輛資料
 * </p>
 *
 * @author system
 * @since 2020-07-04
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("dsg_apply_car")
@ApiModel(value = "DsgApplyCar对象", description = "車輛資料")
public class DsgApplyCar implements Serializable {

    private static final long serialVersionUID = 1L;

    //當請求是來自客服中心的補齊車輛資料時，該字段值不為空
    @TableField(exist = false)
    @ApiModelProperty(value = "")
    private String fromWhere;

    @ApiModelProperty(value = "记账类型")
    @TableField(exist = false)
    private Integer keepType;

    @TableField(exist = false)
    @ApiModelProperty(value = "行车证")
    private String driveLicense;

    @TableField(exist = false)
    @ApiModelProperty(value = "牌薄")
    private String cardBook;

    @TableField(exist = false)
    @ApiModelProperty(value = "其他")
    private String other;

    @JsonFormat(pattern = "dd/MM/yyyy  HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "申请日期")
    @TableField(exist = false)
    private Date applyTime;

    @TableField(exist = false)
    @ApiModelProperty(value = "油卡")
    private List<DsgApplyCard> cardList;

    @TableField(exist = false)
    @ApiModelProperty(value = "申请类型")
    private Integer appType;

    @TableField(exist = false)
    @ApiModelProperty(value = "问卷调查")
    private DsgApplyQuestion question;

    @TableField("APP_NO")
    @ApiModelProperty(value = "申请单号")
    private String appNo;

    @TableField(exist = false)
    @ApiModelProperty(value = "銷售員編號")
    private String salerNo;

    @TableField(exist = false)
    @ApiModelProperty(value = "返单日期起始")
    private String reDateBegin;

    @TableField(exist = false)
    @ApiModelProperty(value = "返单日期截止")
    private String reDateEnd;

    @TableField(exist = false)
    @ApiModelProperty(value = "已錄入是否已录入")
    private boolean isRecorded;

    @ApiModelProperty(value = "主鍵")
    @TableId("OID")
    private String oid;

    @ApiModelProperty(value = "主申請單號")
    @TableField("MAIN_NO")
    private String mainNo;

    @ApiModelProperty(value = "車狀態")
    @TableField("CAR_STATUS")
    private Integer carStatus;

    @ApiModelProperty(value = "原車狀態")
    @TableField("PRE_CAR_STATUS")
    private Integer preCarStatus;

    @ApiModelProperty(value = "车辆使用类型")
    @TableField("CAR_USE_TYPE")
    private Integer carUseType;

//    @ApiModelProperty(value = "資料類型")
//    @TableField("OWNS_TYPE")
//    private Integer ownsType;

    @ApiModelProperty(value = "車牌號碼")
    @TableField("CAR_NO")
    @ExcelProperty(value = "車牌")
    @NotEmpty(message = "車牌不能為空")
    private String carNo;

    @ApiModelProperty(value = "油券")
    @TableField("OIL_POUPON")
    private String oilPoupon;

    @ApiModelProperty(value = "車輛類型")
    @TableField("CAR_TYPE")
    private Integer carType;

    @ApiModelProperty(value = "車輛油種")
    @TableField("CAR_OIL_TYPE")
    private Integer carOilType;

    @ApiModelProperty(value = "車輛牌子")
    @TableField("CAR_BRAND")
    private String carBrand;

    @ApiModelProperty(value = "是否中港車")
    @TableField("CAR_IS_HK")
    private Integer carIsHk;

    @ApiModelProperty(value = "車主姓名或公司")
    @TableField("CAR_OWNER")
    private String carOwner;

    @ApiModelProperty(value = "氣缸容量")
    @TableField("CAR_OIL_CAP")
    private BigDecimal carOilCap;

    @ApiModelProperty(value = "車主ID或者BR")
    @TableField("OWNER_ID")
    private String ownerId;

    @ApiModelProperty(value = "首次登記日期")
    @TableField("FIRST_REG_DATE")
    private Date firstRegDate;

    @ApiModelProperty(value = "最高許可車軸重量")
    @TableField("LIMIT_WEIGHT")
    private BigDecimal limitWeight;

    @ApiModelProperty(value = "座位數")
    @TableField("SEAD_NUM")
    private Integer seadNum;

    @ApiModelProperty(value = "底盤號碼")
    @TableField("CHASSIS_NUB")
    private String chassisNub;

    @ApiModelProperty(value = "扣傭原因")
    @TableField("C_REASON")
    private String cReason;

    /**
     * 创建人
     */
    @TableField(value = "CREATER")
    @ApiModelProperty(value = "创建人", name = "creater")
    private String creater;

    /**
     * 创建时间
     */
    @TableField(value = "CREATE_TIME")
    @ApiModelProperty(value = "创建时间", name = "createTime")
    private Date createTime;

    /**
     * 更新人
     */
    @TableField(value = "UPDATER")
    @ApiModelProperty(value = "更新人", name = "updater")
    private String updater;

    /**
     * 更新时间
     */
    @TableField(value = "UPDATE_TIME")
    @ApiModelProperty(value = "更新时间", name = "updateTime")
    private Date updateTime;

    @ApiModelProperty(value = "卡狀態")
    @TableField(exist = false)
    private Integer cardStatus;

    @ApiModelProperty(value = "卡號")
    @TableField(exist = false)
    private String cardNo;

    @ApiModelProperty(value = "客戶編號")
    @TableField("CUS_NO")
    private String cusNo;

    @ApiModelProperty(value = "Check車牌批次號")
    @TableField(exist = false)
    @ExcelProperty(value = "批次號")
    @NotEmpty(message = "批次號不能為空")
    private String checkBatchNo;

    @ApiModelProperty(value = "Check車牌狀態")
    @TableField(exist = false)
    @ExcelProperty(value = "狀態")
    @NotEmpty(message = "狀態不能為空")
    private Integer checkStatus;

    @ApiModelProperty(value = "油咭類型")
    @TableField(exist = false)
    @ExcelProperty(value = "油咭類型")
    @NotEmpty(message = "油咭類型不能為空")
    private String cardType;

    @ApiModelProperty(value = "Check车牌审批结果")
    @TableField(exist = false)
    @ExcelProperty(value = "原因")
    private String checkApprovalResult;

    @TableField(exist = false)
    @ApiModelProperty(value = "返单日期")
    private Date reDate;

    @TableField(exist = false)
    @ApiModelProperty(value = "申請單狀態OID")
    private String statusID;

    @TableField(exist = false)
    @ApiModelProperty(value = "上form編號")
    private String formNo;

    @TableField(exist = false)
    @ApiModelProperty(value = "上form日期")
    private Date formDate;

    @TableField(exist = false)
    @ApiModelProperty(value = "上form狀態")
    private Integer formStatus;

    @TableField(exist = false)
    @ApiModelProperty(value = "咭面名")
    private String cardFaceName;

    @TableField(exist = false)
    @ApiModelProperty(value = "油咭分類")
    private Integer cardClassify;

    @TableField(exist = false)
    @ApiModelProperty(value = "油咭类型（现金咭）")
    private String cardType1;

    @ApiModelProperty(value = "是否现有客户")
    @TableField(exist = false)
    private Integer isExistCus;

    @ApiModelProperty(value = "是否现有客户")
    @TableField(exist = false)
    private String isExistCusNm;

    @ApiModelProperty(value = "帳戶編號")
    @TableField(exist = false)
    private String accountNo;

    @ApiModelProperty(value = "sub A/C")
    @TableField(exist = false)
    private String subAC;

    @ApiModelProperty(value = "序号")
    @TableField(exist = false)
    private Integer serialNumber;

    @ApiModelProperty(value = "最後使用時間")
    @TableField(exist = false)
    @ExcelProperty(value = "最後使用時間")
    private Date checkLastTime;

    @ApiModelProperty(value = "最後使用時間開始")
    @TableField(exist = false)
    private String checkLastTimeBegin;

    @ApiModelProperty(value = "最後使用時間結束")
    @TableField(exist = false)
    private String checkLastTimeEnd;

    @ApiModelProperty(value = "油公司编号", name = "oilComNo")
    @TableField(exist = false)
    private String oilComNo;

    @ApiModelProperty(value = "是否odometer")
    @TableField(exist = false)
    private Integer isOdometer;

    @ApiModelProperty(value = "油咭限額ID")
    @TableField(exist = false)
    private String limitId;

    @ApiModelProperty(value = "代理公司简称")
    @TableField(exist = false)
    private String embossedName;

    @ApiModelProperty(value = "pin")
    @TableField(exist = false)
    private String pin;

    @ApiModelProperty(value = "vehicleEntry")
    @TableField(exist = false)
    private String vehicleEntry;

    @ApiModelProperty(value = "nonFuel")
    @TableField(exist = false)
    private String nonFuel;

    @ApiModelProperty(value = "Odometer")
    @TableField(exist = false)
    private String odometer;

    @ApiModelProperty(value = "fuel")
    @TableField(exist = false)
    private String fuel;

    @ApiModelProperty(value = "申請類型集合以,號隔開")
    @TableField(exist = false)
    private String appTypeList;

    @ApiModelProperty(value = "附加信息/车辆登记")
    @TableField(exist = false)
    private String rmk;

    @ApiModelProperty(value = "節點配置名稱")
    @TableField(exist = false)
    private String nodeName;

    @ApiModelProperty(value = "咭表OID")
    @TableField(exist = false)
    private String cardOid;

    @TableField(exist = false)
    @ApiModelProperty(value = "申請單OID")
    private String billOid;

    @TableField(exist = false)
    @ApiModelProperty(value = "申請單狀態")
    private Integer appStatus;

    @TableField(exist = false)
    @ApiModelProperty(value = "檢測油咭庫存 Y:是")
    private String isCheck;
    /**
     * 企業編號
     */
    @TableField(value = "ENT_CODE")
    @ApiModelProperty(value = "企業編號", name = "entCode")
    private String entCode;

    @TableField(value = "CAR_NO_HK")
    @ApiModelProperty(value = "中港车牌号码")
    private String carNoHK;

    @TableField(value = "BOOK_REG_DATE")
    @ApiModelProperty(value = "牌薄登記日期", name = "bookRegDate")
    private Date bookRegDate;

    @ApiModelProperty(value = "牌照屆滿日期")
    @TableField("LICENCE_EXPIRY_DATE")
    private Date licenceExpiryDate;

    @TableField(value = "FEE_SEL")
    @ApiModelProperty(value = "佣金选项")
    private String feeSel;

    @ApiModelProperty(value = "核对状态")
    @TableField("VERIFY")
    private Integer verify;

    @ApiModelProperty(value = "通讯录主键")
    @TableField("COMM_ID")
    private String commId;

    @ApiModelProperty(value = "原因")
    @TableField(exist = false)
    private String remark;

    @TableField(exist = false)
    private String userId;

    /** 无佣金 */
    public static final int FEE_SEL_NO = 0;
    /** 二折 */
    public static final int FEE_SEL_TWO = 1;

    /** 未核对 */
    public static final Integer VERIFY_NO = 0;
    /** 完成核对 */
    public static final Integer VERIFY_YES = 1;

    /**
     * 錄入
     */
    public static final int CAR_STATUS_RECORD = 0;
    /**
     * 生效
     */
    public static final int CAR_STATUS_EFFECT = 1;
    /**
     * 取消
     */
    public static final int CAR_STATUS_CANCEL = 2;
    /**
     * 未錄入
     */
    public static final int CAR_STATUS_NOT_RECORD = 3;
    /**
     * 已轉移油咭
     */
    public static final int CAR_STATUS_TRAN = 4;
    /**
     * 已翻生
     */
    public static final int CAR_STATUS_REBORN = 5;

    /**
     * 本地車
     */
    public static final int CAR_TYPE_LOCAL = 1;
    /**
     * 中港車
     */
    public static final int CAR_TYPE_HK = 2;
    /**
     * 電單車
     */
    public static final int CAR_TYPE_MOBILE = 3;

    /**
     * 汽油
     */
    public static final int CAR_OIL_TYPE_GAS = 1;
    /**
     * 柴油
     */
    public static final int CAR_OIL_TYPE_DIESEL = 2;

    public static final int CAR_IS_HK_N = 0;
    public static final int CAR_IS_HK_Y = 1;

    /************************枚舉**********************/
    public enum AppStatus {
        chargeCard(1), cashCard(2);
        Integer code;

        AppStatus(int code) {
            this.code = code;
        }

        public Integer getCode() {
            return code;
        }
    }
}
